package com.tcfvic.client.panels.widgets;

import com.google.gwt.user.client.ui.DecoratedPopupPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;

public class SimpleMessagePopup {
	
	private DecoratedPopupPanel simplePopup;
	
	public SimpleMessagePopup(String message, Widget source) {
		simplePopup = new DecoratedPopupPanel(true);
	    simplePopup.ensureDebugId("cwBasicPopup-simplePopup");
	    simplePopup.setWidth("300px");
	    simplePopup.setWidget(new HTML(message));
	    int left = 400;
	    int top = 400;
	    if (source != null) {
		    left = source.getAbsoluteLeft() + 10;
	        top = source.getAbsoluteTop() + 10;
	    }
        simplePopup.setPopupPosition(left, top);
	}
	
	public void showPopup() {
		simplePopup.show();
	}

}
